package com.leadership.training.entity.project;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.leadership.training.entity.trainee.Trainee;

/**
 * 
 * @author xiaoHU
 *
 */
@Entity
@Table(name = "t_surver_notifaction")
public class SurveyNotifaction {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 项目-期
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private ProjectPhase projectPhase;

    /**
     * 学员
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    private Trainee trainee;

    /**
     * 状态是否发送
     */
    private boolean send;

    /**
     * 问卷调查链接
     */
    private String link;

    /**
    * 
    */
    @Column(name = "is_disabled")
    private boolean disabled;

    /**
     * The default constructor
     */
    public SurveyNotifaction() {
    }
    
    /**
     * 
     * @param projectPhase
     * @param trainee
     */
    public SurveyNotifaction(ProjectPhase projectPhase, Trainee trainee) {
    	this.trainee = trainee;
    	this.projectPhase = projectPhase;
    	this.disabled = false;
    	this.send = false;
    	this.link = "survey?id="+projectPhase.getId();
    	
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return the projectPhase
     */
    public ProjectPhase getProjectPhase() {
        return projectPhase;
    }

    /**
     * @param projectPhase the projectPhase to set
     */
    public void setProjectPhase(ProjectPhase projectPhase) {
        this.projectPhase = projectPhase;
    }

    /**
     * @return the trainee
     */
    public Trainee getTrainee() {
        return trainee;
    }

    /**
     * @param trainee the trainee to set
     */
    public void setTrainee(Trainee trainee) {
        this.trainee = trainee;
    }

    /**
     * @return the send
     */
    public boolean isSend() {
        return send;
    }

    /**
     * @param send the send to set
     */
    public void setSend(boolean send) {
        this.send = send;
    }

    /**
     * @return the link
     */
    public String getLink() {
        return link;
    }

    /**
     * @param link the link to set
     */
    public void setLink(String link) {
        this.link = link;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

}
